/*!
\copyright  Copyright (c) 2023-2025 Qualcomm Technologies International, Ltd.\n
            All Rights Reserved.\n
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file       usb_audio_class_20_default_descriptors.h
\ingroup    usb_audio
\brief      Header file for using default descriptors of USB Audio class 2.0
*/

#ifndef USB_AUDIO_CLASS_20_DEFAULT_DESCRIPTORS_H_
#define USB_AUDIO_CLASS_20_DEFAULT_DESCRIPTORS_H_

#include "usb_audio.h"
#include "usb_audio_class_20_descriptors.h"

/* Unit/Terminal IDs Used by default descriptors*/
#define UAC2_ID_SPKR_VOICE_IT  0x01
#define UAC2_ID_SPKR_VOICE_FU  0x02
#define UAC2_ID_SPKR_VOICE_OT  0x03
#define UAC2_ID_MIC_VOICE_IT   0x04
#define UAC2_ID_MIC_VOICE_FU   0x05
#define UAC2_ID_MIC_VOICE_OT   0x06
#define UAC2_ID_SPKR_AUDIO_IT  0x07
#define UAC2_ID_SPKR_AUDIO_FU  0x08
#define UAC2_ID_SPKR_AUDIO_OT  0x09
#define UAC2_ID_MIC_CLOCK_SOURCE   0x0A
#define UAC2_ID_SPKR_CLOCK_SOURCE   0x0B

#define UAC2_VOICE_MIC_CHANNELS        USB_AUDIO_CHANNELS_MONO
#define UAC2_VOICE_SPKR_CHANNELS       USB_AUDIO_CHANNELS_MONO
#define UAC2_AUDIO_SPKR_CHANNELS       USB_AUDIO_CHANNELS_STEREO

#define UAC2_AUDIO_MASTER_CONTROLS ((3 << ((UAC_FU_MUTE_CONTROL - 1)*2)) | \
                                    (3 << ((UAC_FU_VOLUME_CONTROL - 1)*2)))
#define UAC2_VOICE_MASTER_CONTROLS  (3 << ((UAC_FU_MUTE_CONTROL - 1)*2))

#define UAC2_SPEAKER_FORMATS (UAC_FORMAT_1_PCM)
#define UAC2_MIC_FORMATS (UAC_FORMAT_1_PCM)

#if UAC2_VOICE_SPKR_CHANNELS == USB_AUDIO_CHANNELS_STEREO
#define UAC2_VOICE_SPKR_CHANNEL_CONFIG  0x03
#elif UAC2_VOICE_SPKR_CHANNELS == USB_AUDIO_CHANNELS_MONO
#define UAC2_VOICE_SPKR_CHANNEL_CONFIG  0x01
#else
#error NOT_SUPPORTED
#endif

#if UAC2_VOICE_MIC_CHANNELS == USB_AUDIO_CHANNELS_STEREO
#define UAC2_VOICE_MIC_CHANNEL_CONFIG   0x03
#elif UAC2_VOICE_MIC_CHANNELS == USB_AUDIO_CHANNELS_MONO
#define UAC2_VOICE_MIC_CHANNEL_CONFIG   0x01
#else
#error NOT_SUPPORTED
#endif

#if UAC2_AUDIO_SPKR_CHANNELS == USB_AUDIO_CHANNELS_STEREO
#define UAC2_AUDIO_SPKR_CHANNEL_CONFIG  0x03
#elif UAC2_AUDIO_SPKR_CHANNELS == USB_AUDIO_CHANNELS_MONO
#define UAC2_AUDIO_SPKR_CHANNEL_CONFIG  0x01
#else
#error NOT_SUPPORTED
#endif

#define UAC2_USB_AUDIO_SAMPLE_SIZE_8_BIT    1
#define UAC2_USB_AUDIO_SAMPLE_SIZE_16_BIT   2
#define UAC2_USB_AUDIO_SAMPLE_SIZE_24_BIT   3
#define UAC2_USB_AUDIO_SAMPLE_SIZE_32_BIT   4

/* Voice Mic interface descriptors */
extern const uac_control_config_t         uac2_voice_control_mic_desc;
extern const uac_streaming_config_t       uac2_voice_streaming_mic_desc[];
extern const uac_endpoint_config_t        uac2_voice_mic_endpoint;

extern const uac_control_config_t         uac2_voice_control_spkr_desc;
extern const uac_streaming_config_t       uac2_voice_streaming_spkr_desc[];
extern const uac_endpoint_config_t        uac2_voice_spkr_endpoint;

extern const usb_audio_interface_config_list_t uac2_voice_interfaces;

/* Audio Speaker interface descriptors */
extern const uac_control_config_t         uac2_music_control_spkr_desc;
extern const uac_streaming_config_t       uac2_music_streaming_spkr_desc[];
extern const uac_endpoint_config_t        uac2_music_spkr_endpoint;

extern const usb_audio_interface_config_list_t uac2_music_interfaces;

/* Audio Speaker Voice Mic interface descriptors */
extern const usb_audio_interface_config_list_t uac2_music_spkr_voice_mic_interfaces;

#endif /* USB_AUDIO_CLASS_20_DEFAULT_DESCRIPTORS_H_ */
